// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 新增接口 POST /api/addApiInfo */
export async function postAddApiInfo(body: API.AddApiInfoVo, options?: { [key: string]: any }) {
  return request<API.Response>('/api/addApiInfo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 获取接口信息 GET /api/getApiInfo/${param0} */
export async function getGetApiInfoId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getGetApiInfoIdParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response>(`/api/getApiInfo/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取接口列表 GET /api/getApiInfoList */
export async function getGetApiInfoList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getGetApiInfoListParams,
  options?: { [key: string]: any },
) {
  return request<API.Response>('/api/getApiInfoList', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 调用接口 POST /api/invokeInterface/${param0} */
export async function postInvokeInterfaceId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.postInvokeInterfaceIdParams,
  body: Record<string, any>,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response>(`/api/invokeInterface/${param0}`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    params: { ...queryParams },
    data: body,
    ...(options || {}),
  });
}

/** 下线接口 PUT /api/offlineInterface/${param0} */
export async function putOfflineInterfaceId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.putOfflineInterfaceIdParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response>(`/api/offlineInterface/${param0}`, {
    method: 'PUT',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 上线接口 PUT /api/onlineInterface/${param0} */
export async function putOnlineInterfaceId(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.putOnlineInterfaceIdParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.Response>(`/api/onlineInterface/${param0}`, {
    method: 'PUT',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 更新接口 POST /api/updateApiInfo */
export async function postUpdateApiInfo(
  body: API.UpdateApiInfoVo,
  options?: { [key: string]: any },
) {
  return request<API.Response>('/api/updateApiInfo', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
